import request from '../utils/request'

/** *
 * 获取权限列表
 * **/

export function getPermissionList() {
  return request({
    url: '/sys/permission'
  })
}
// 新增权限
interface Iper{
   code:string,
    description:string,
    enVisible:string,
    name:string,
    pid:number
    type:number
}
export function addPermission(data:Iper) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 更新权限
export function updatePermission(data:any) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

// 删除权限
export function delPermission(id:any) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}
// 获取权限详情
export function getPermissionDetail(id:any) {
  return request({
    url: `/sys/permission/${id}`
  })
}
